package com.gome.oa.custom.editor;

import java.awt.Component;

import javax.swing.AbstractCellEditor;
import javax.swing.JComboBox;
import javax.swing.JTable;
import javax.swing.table.TableCellEditor;

/**
 *
 * @author: tang li
 * @date: 2016年8月20日
 * @desc:
 *
 */
public class ComBoxTableCellEditor extends AbstractCellEditor implements TableCellEditor {

	private static final long serialVersionUID = -6573800225088575750L;
	private JComboBox<?> comboBox;

	public Component getTableCellEditorComponent(final JTable table, final Object value, final boolean isSelected, final int row,
			final int column) {
		
		comboBox = (JComboBox<?>)value;
		
		return comboBox;
	}

	/**
	 * 编辑完后, cellRender使用
	 */
	public Object getCellEditorValue() {
		return comboBox;
	}

}
